package com.service.bean;


import java.sql.Timestamp;
import java.text.MessageFormat;
import java.util.Date;

public class Road_MixingSignal {

	/**
	 * 表名
	 */
	public int tableName;
	
	/**
	 * 序号
	 */
	public int id;	
	/**
	 * 设备编号
	 */
	public String equipmentNO;
	/**
	 * 拌合楼表序号
	 */
	public int mixingId;	
	/**
	 * 用户名
	 */
	public String userName;
	/**
	 * 配方
	 */
	public int formula;
	/**
	 * 石料1
	 */
	public double stone1;
	/**
	 * 石料2
	 */
	public double stone2;
	/**
	 * 石料3
	 */
	public double stone3;
	/**
	 * 石料4
	 */
	public double stone4;
	/**
	 * 石料5
	 */
	public double stone5;
	/**
	 * 石料6
	 */
	public double stone6;
	/**
	 * 沥青
	 */
	public double asphalt;
	/**
	 * 粉料1
	 */
	public double powderLot1;
	/**
	 * 粉料2
	 */
	public double powderLot2;
	/**
	 * 粗料
	 */
	public double thickPowder;
	/**
	 * 细料
	 */
	public double thinPowder;
	/**
	 * 添加剂
	 */
	public double additive;
	/**
	 * 温度
	 */
	public double mixingTemp;
	/**
	 * 每锅总量
	 */
	public double mixingTotal;
	/**
	 * 时间
	 */
	public Date mixingTime;
	/**
	 * 时间
	 */
	public String companyCode;
	/**
	 * 配方名
	 */
	public String formulaName;
	/**
	 * 油比(油石比)
	 */
	public double aggregateRatio;
	/**
	 * 混合料温度
	 */
	public double powderLotTemp;
	/**
	 * 除尘器入口温度
	 */
	public double dustTemp;
	/**
	 * 沥青温度
	 */
	public double asphaltTemp;
	/**
	 * 骨料温度
	 */
	public double stoneTemp;
	/**
	 * 石料7(AM01旁通)
	 */
	public double stone7;
	/**
	 * 改性沥青(AB04)
	 */
	public double asphalt2;
	/**
	 * 改性沥青(AB01)
	 */
	public double asphalt3;
	/**
	 * 改性沥青(AB02)
	 */
	public double asphalt4;
	
	public double mixingTemp2;

	public Object[] getAll() {
		Object[] array = new Object[31];
		array[0] = "'" + this.equipmentNO + "'";
		array[1] = String.valueOf(this.mixingId);
		array[2] = "'" + this.userName + "'";
		array[3] = String.valueOf(this.formula);
		array[4] = String.valueOf(this.stone1);
		array[5] = String.valueOf(this.stone2);
		array[6] = String.valueOf(this.stone3);
		array[7] = String.valueOf(this.stone4);
		array[8] = String.valueOf(this.stone5);
		array[9] = String.valueOf(this.stone6);
		array[10] = String.valueOf(this.asphalt);
		array[11] = String.valueOf(this.powderLot1);
		array[12] = String.valueOf(this.powderLot2);
		array[13] = String.valueOf(this.thickPowder);
		array[14] = String.valueOf(this.thinPowder);
		array[15] = String.valueOf(this.additive);
		array[16] = String.valueOf(this.mixingTemp);
		array[17] = String.valueOf(this.mixingTotal);
		array[18] = this.mixingTime == null ? this.mixingTime : "'" + new Timestamp(this.mixingTime.getTime()) + "'";
		array[19] = "'" + this.companyCode + "'";
		array[20] = this.formulaName == null ? this.formulaName : "'" + this.formulaName + "'";
		array[21] =  String.valueOf(this.aggregateRatio);
		array[22] =  String.valueOf(this.powderLotTemp);
		array[23] =  String.valueOf(this.dustTemp);
		array[24] =  String.valueOf(this.asphaltTemp);
		array[25] =  String.valueOf(this.stoneTemp);
		array[26] =  String.valueOf(this.stone7);
		array[27] =  String.valueOf(this.asphalt2);
		array[28] =  String.valueOf(this.asphalt3);
		array[29] =  String.valueOf(this.asphalt4);
		array[30] = String.valueOf(this.mixingTemp2);
		return array;
	}
	
	public Object[] getAllForJson() {
		Object[] array = getAll();
		array[0] = "\"" + this.equipmentNO + "\"";
		array[2] = "\"" + this.userName + "\"";
		array[18] = this.mixingTime == null ? this.mixingTime : "\"" + new Timestamp(this.mixingTime.getTime()) + "\"";		
		array[19] = "\"" + this.companyCode + "\"";
		return array;
	}
	
	@Override
	public String toString() {
		StringBuilder sBuilder = new StringBuilder();

		sBuilder.append("\"equipmentNO\":{0},");
		sBuilder.append("\"mixingId\":{1},");
		sBuilder.append("\"userName\":{2},");
		sBuilder.append("\"formula\":{3},");
		sBuilder.append("\"stone1\":{4},");
		sBuilder.append("\"stone2\":{5},");
		sBuilder.append("\"stone3\":{6},");
		sBuilder.append("\"stone4\":{7},");
		sBuilder.append("\"stone5\":{8},");
		sBuilder.append("\"stone6\":{9},");		
		sBuilder.append("\"asphalt\":{10},");
		sBuilder.append("\"powderLot1\":{11},");
		sBuilder.append("\"powderLot2\":{12},");
		sBuilder.append("\"thickPowder\":{13},");
		sBuilder.append("\"thinPowder\":{14},");
		sBuilder.append("\"additive\":{15},");		
		sBuilder.append("\"mixingTemp\":{16},");
		sBuilder.append("\"mixingTotal\":{17},");
		sBuilder.append("\"mixingTime\":{18},");
		sBuilder.append("\"companyCode\":{19},");
		sBuilder.append("\"formulaName\":{20},");
		sBuilder.append("\"aggregateRatio\":{21},");		
		sBuilder.append("\"powderLotTemp\":{22},");
		sBuilder.append("\"dustTemp\":{23},");
		sBuilder.append("\"asphaltTemp\":{24},");
		sBuilder.append("\"stoneTemp\":{25},");
		sBuilder.append("\"stone7\":{26},");
		sBuilder.append("\"asphalt2\":{27},");
		sBuilder.append("\"asphalt3\":{28},");
		sBuilder.append("\"asphalt4\":{29},");
		sBuilder.append("\"mixingTemp2\":{30},");

		return MessageFormat.format(sBuilder.toString(),this.getAllForJson());
	}
}
